From: David Härdeman Date: Fri, 12 Dec 2025 20:30:18 +0000 (+0100) Subject: dhcpv4: fix DNS server option X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22http:/www.crowdsec.net/%22/%22https:/collectd.org/%22http:/www.crowdsec.net/%22?a=commitdiff_plain;h=e8b7fdea8d5e39c263514204642865c195a3294f;p=project%2Fodhcpd.git dhcpv4: fix DNS server option The iface->dhcpv4_own_ip struct is not a struct in_addr, so change the code so that the iov takes the actual IPv4 address. Closes: https://github.com/openwrt/odhcpd/issues/344 Signed-off-by: David Härdeman Link: https://github.com/openwrt/odhcpd/pull/345 Signed-off-by: Álvaro Fernández Rojas --- diff --git a/src/dhcpv4.c b/src/dhcpv4.c index 31ef1e5..6dbc61d 100644 --- a/src/dhcpv4.c +++ b/src/dhcpv4.c @@ -1119,8 +1119,8 @@ void dhcpv4_handle_msg(void *src_addr, void *data, size_t len, reply_dnsserver.len = iface->dns_addrs4_cnt * sizeof(*iface->dns_addrs4); iov[IOV_DNSSERVER_ADDRS].iov_base = iface->dns_addrs4; } else { - reply_dnsserver.len = sizeof(iface->dhcpv4_own_ip); - iov[IOV_DNSSERVER_ADDRS].iov_base = &iface->dhcpv4_own_ip; + reply_dnsserver.len = sizeof(iface->dhcpv4_own_ip.addr.in); + iov[IOV_DNSSERVER_ADDRS].iov_base = &iface->dhcpv4_own_ip.addr.in; } iov[IOV_DNSSERVER_ADDRS].iov_len = reply_dnsserver.len; break;